﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Admin.NET.Database.Migrations.Migrations
{
    public partial class V102 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "IT_CarInfo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "Id主键"),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "名称"),
                    CarNum = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "名称"),
                    GPS = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "默认GPS"),
                    Status = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true, comment: "状态"),
                    IsOnLine = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true, comment: "是否在线"),
                    Speed = table.Column<double>(type: "float", nullable: false, comment: "最大速度"),
                    Mileage = table.Column<double>(type: "float", nullable: false, comment: "行驶里程"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建者名称"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改者名称"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IT_CarInfo", x => x.Id);
                },
                comment: "巡检车信息表");

            migrationBuilder.CreateTable(
                name: "IT_Plan_Target",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "Id主键"),
                    PlanId = table.Column<long>(type: "bigint", nullable: false, comment: "计划ID"),
                    GPS = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: true, comment: "目标GPS"),
                    Name = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "目标名称"),
                    IMG = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "目标图片地址"),
                    Area = table.Column<double>(type: "float", nullable: false, comment: "目标面积"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建者名称"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改者名称"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IT_Plan_Target", x => x.Id);
                },
                comment: "巡检目标表");

            migrationBuilder.CreateTable(
                name: "IT_Plan_GPS",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "Id主键"),
                    PlanId = table.Column<long>(type: "bigint", maxLength: 40, nullable: false, comment: "计划ID"),
                    GPS = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: true, comment: "GPS"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建者名称"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改者名称"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IT_Plan_GPS", x => x.Id);
                },
                comment: "巡检GPS表");

            migrationBuilder.CreateTable(
                name: "IT_Plan_Info",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "Id主键"),
                    PlanName = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "计划名称"),
                    PlanGPS = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "计划GPS"),
                    PlanType = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true, comment: "计划类型"),
                    PlanStatus = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true, comment: "计划状态"),
                    CarId = table.Column<long>(type: "bigint", nullable: false, comment: "计划状态"),
                    CarryDt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "巡检时间"),
                    PlanDt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "计划时间"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建者名称"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改者名称"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IT_Plan_Info", x => x.Id);
                },
                comment: "计划表");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "IT_CarInfo");

            migrationBuilder.DropTable(
                name: "IT_Plan_Target");

            migrationBuilder.DropTable(
                name: "IT_Plan_GPS");

            migrationBuilder.DropTable(
                name: "IT_Plan_Info");
        }
    }
}
